/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.atomojo.app.storage.xmldb;

import org.atomojo.app.ComponentModule;
import org.exist.restlet.XMLDBResource;
import org.restlet.Context;
import org.restlet.routing.Router;
import org.restlet.routing.Template;

/**
 *
 * @author alex
 */
public class XMLDBComponentModule implements ComponentModule {

   public XMLDBComponentModule() {
   }
   public String getName() {
      return "exist-xmldb";
   }
   public void init(Context context, Router router) {
      context.getLogger().info("Attaching eXist XML DB to internal router.");
      router.attach("/exist/",XMLDBResource.class).getTemplate().setMatchingMode(Template.MODE_STARTS_WITH);
   }
   public void start() {
   }
   public void stop() {

   }
}
